<?php
/**
 * Created by PhpStorm.
 * User: 123
 * Date: 2021/3/31
 * Time: 0:48
 */
namespace app\adminapi\controller;

use app\common\controller\Adminapi;
use think\captcha\Captcha;

/**
 * 验证码
 * Class Code
 * @package app\adminapi\controller
 */
class Code extends Adminapi {

    protected $noNeedLogin = ['*'];
    protected $noNeedRight = ['*'];

    // 显示验证码
    public function index()
    {
        $captcha = new Captcha();
        // 设置验证码字符为纯数字
        $captcha->codeSet = '0123456789';
        $captcha->length = 4;
        return $captcha->entry();
    }

}